// 评论相关类型定义

export interface Comment {
  id: string
  blogId: string
  parentId?: string
  rootId?: string
  replyToUserId?: string
  replyToNickname?: string
  level: number
  path: string
  nickname: string
  email?: string
  website?: string
  content: string
  status: number
  likeCount: number
  replyCount: number
  totalReplyCount: number
  isAuthor: boolean
  isTop: boolean
  createTime: string
  createTimeFormat: string
  relativeTime?: string
  children?: Comment[]
  expanded?: boolean
  hasMore?: boolean
  childrenTotal?: number
  isLiked?: boolean
  canReply?: boolean
  canDelete?: boolean
  avatarUrl?: string
  userLevel?: number
  deviceInfo?: string
  location?: string
}

export interface CommentSaveParam {
  blogId: string
  parentId?: string
  replyToUserId?: string
  replyToNickname?: string
  content: string
  nickname: string
  email?: string
  website?: string
}

export interface CommentTreeParam {
  blogId: string
  pageNum?: number
  pageSize?: number
  childrenLimit?: number
  sortType?: 'latest' | 'oldest' | 'hot'
  onlyTopLevel?: boolean
}

export interface LoadMoreChildrenParam {
  parentId: string
  offset?: number
  limit?: number
}

export interface CommentLikeParam {
  commentId: string
  isLike?: boolean
}

export interface CommentStats {
  totalComments: number
  topLevelComments: number
  replyComments: number
}

export interface CommentPageResponse {
  current: number
  pages: number
  records: Comment[]
  size: number
  total: number
}
